• Coordination problem (rough):
    • resource sharing: concurrent updates
    • agree on actions: do something or not
    • dynamically re-assign the role of master
  • Re-assignment of master, difficulties:
    • Centralization is not good because central server may die
    • Fixed master-slave not good because process may crash
  • Coordination problem (specific):
    • Mutual exclusion
    • Leader elections
    • Consensus (Agreement)
  • Failure assumptions:
    • Links are reliable, but process may die
    • Failure detection service (heartbeat every T secs)
    • Observation of failures:
      • suspected failure: no heartbeat after (T + e) secs
      • unsuspected: some process crashed but no clue about this
      • ...
  • Distributed mutual exclusion
    • Problem conditions:
      • N asynchronouse processes
      • No failures, reliable links
      • For critical section (CS), each process executes: enter(), resourceAccess(), exit()
    • Problem requirements
      • ME1: At most 1 process is in CS at the same time
      • ME2: Requests to enter() and exit() will be done eventually
      • ME3: CS are accessed in the order of enter()
    • Solution 1: Centralized mutual exclusion. It works (without ME3)
    • Solution 2: Ring-based algorithm, process form a fing, an access token rotates around the ring
      • Data link layer need to solve this problem. Before ethernet, this layer used the token ring method
      • Disadvantages: continuous use of network bandwidth; delay depends of the size of ring
    • Solution 3: Ricart-Agrawala algorithm: use Lamport's logical clock
  • Leader election algorithms
    • Problem conditions
    • Requirements:
      • LE1: Every process knows P (the id of leader)
      • LE2: Every process finally discovers the leader
    • Solution 1: Chang & Roberts algorithm: ring based election
  • Aggrement
    • Application: transaction processing, mutual exclusion, control system
    • Model:
      • N process + message passing + (sync or async) + reliable links
      • Process may crash or Arbitrary failures
      • Requirements: works in certain kind of failure
    • Main idea:
      • Initially: all processes are in "undecided" state, propose a value from a set D
      • Then: processes communicate and decide; value cannot be changed once a process is in "decided" state
    • Requirements:
      • Termination: every correct process eventually makes its decision
      • Agreement: every correct process agrees on the same value
    • Solution 1: majority votes
      • Everyone multicasts its own value and takes the major value
      • Cannot aford failures
      • (Lamport) Three generals problem